using System;
using System.Collections.Generic;
using PCC.App;
using PCC.CQRS;
using PCC.Receiver.Database;
using PCC.Receiver.Notification;

namespace PCC.Command.User
{
    public class Registers : CommandBase
    {
        private Registers(IEnumerable<IReceiver> receivers)
            : base(receivers)
        { }

        public static Registers GetCommand(DataManager dataManager, NotificationManager notificationManager, string username, string email, string password, string passwordQuestion, string passwordAnswer)
        {
            Guid Id = Guid.NewGuid();
            return
                new Registers(
                    new IReceiver[]
                        {
                            new CreateUser(dataManager, username, password, email, passwordQuestion,
                                           passwordAnswer, Id),
                            new ValidateEMail(notificationManager, username, email, Id)
                        }
                    );
        }
    }
}